home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume5 / pc-curses-1.3 / part1 < prev    next >
Encoding:
Internet Message Format  |  1989-02-03  |  58.7 KB

  1. Path: xanth!nic.MR.NET!hal!ncoast!allbery
  2. From: creps@silver.bacs.indiana.edu (Steve Creps)
  3. Newsgroups: comp.sources.misc
  4. Subject: v05i023: PCcurses version 1.3, part 1/5
  5. Message-ID: <2565@silver.bacs.indiana.edu>
  6. Date: 31 Oct 88 02:49:11 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Reply-To: creps@silver.bacs.indiana.edu (Steve Creps)
  9. Organization: IU CS Dept
  10. Lines: 1633
  11. Approved: allbery@ncoast.UUCP
  12.  
  13. Posting-number: Volume 5, Issue 23
  14. Submitted-by: "Steve Creps" <creps@silver.bacs.indiana.edu>
  15. Archive-name: pc-curses-1.3/Part1
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 1 (of 5)."
  24. # Contents:  README.NOW beep.c border.c charpick.c curses.cmd endwin.c
  25. #   farcall.inc hugedata.inc initscr.c longname.c move.c mvcursor.c
  26. #   nearcall.inc scrreg.c smaldata.inc stradd.c tabsize.c termmisc.c
  27. #   unctrl.c winclear.c windel.c winerase.c winmove.c winscrol.c
  28. #   wintouch.c
  29. # Wrapped by creps@silver on Fri Oct 28 17:43:05 1988
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'README.NOW' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'README.NOW'\"
  33. else
  34. echo shar: Extracting \"'README.NOW'\" \(12183 characters\)
  35. sed "s/^X//" >'README.NOW' <<'END_OF_FILE'
  36. X               PCCURSES v.1.3 Release Notes - 881005
  37. X    ===================================================
  38. X
  39. X  This is the release note for the fourth version of PCcurses, v.1.3.
  40. XBelow this note, the release notes for v.1.0, v.1.1 and v.1.2 are in-
  41. Xcluded. Read those first.
  42. X
  43. X  The file 'border.c' is now included. It allows you to explicitely speci-
  44. Xfy what characters should be used as box borders when the box() functions
  45. Xare called. If the new border characters are non-0, they override the bor-
  46. Xder characters specified in the box() call. In my understanding, this func-
  47. Xtionality is required for AT&T UNNIX sV.3 compatibility. Thanks for this
  48. Xgoes to Tony L. Hansen (hansen@pegasus.UUCP) for posting an article about
  49. Xit on UseNet (newsgrou comp.unix.questions; the posting was not related at
  50. Xall to PCcurses).
  51. X
  52. X  The only other difference between v.1.2 and v.1.3 is that the latter has
  53. Xbeen changed to avoid warning diagnostics if the source files are compiled
  54. Xwith warning switches on (for MicroSoft this means '-W3', for Turbo'C' it
  55. Xmeans '-w -w-pro'). Of these, the Turbo'C' warning check is clearly to be
  56. Xused rather than MicroSoft, even if neither of them comes even close to a
  57. Xreal UNIX 'lint'. Some of the warnings in fact indicated real bugs, mostly
  58. Xfunctions that did not return correct return values or types.
  59. X
  60. X  The makefiles for both MSC and TRC have been modified to produce warning
  61. Xmessages as part of normal compilation.
  62. X
  63. X
  64. X
  65. X
  66. X               PCCURSES v.1.2 Release Notes - 881002
  67. X    ===================================================
  68. X
  69. X  This is the release note for the third version of PCcurses, v.1.2.
  70. XBelow this note, the release notes for v.1.0 and v.1.1 are included. Read
  71. Xthose first.
  72. X
  73. X  The changes from v.1.1 to v.1.2 are minor. The biggest change is that there
  74. Xwas a bug related to limiting the cursor movement if the application tried to
  75. Xmove it outside the screen (something that should not be done anyway). Such
  76. Xerronous application behaviour is now handled correctly.
  77. X
  78. X  All modules have been changed to have a revison string in them, which makes
  79. Xit easier to determine what version is linked into a program (or what library
  80. Xversion you have).
  81. X
  82. X  There is now a 'cursesio.c' file. That file does the same as 'cursesio.asm'
  83. X(i.e. it provides the interface to the lower-level system I/O routines). It
  84. Xis written in 'C' and thus it is (possibly) more portable than the assembler
  85. Xversion (but still not so portable since it uses 8086 INT XX calls directly).
  86. XWhen one creates new curses libraries, one chooses whether to use the assem-
  87. Xbler or the 'C' version of cursesio. The choice is made by commenting out the
  88. Xappropriate dependencies for cursesio.obj, near the end of the makefiles.
  89. X
  90. X  There is now a 'setmode.c' file. That file contains functions that save and
  91. Xrestore terminal modes. They do it into other variables than do savetty() and
  92. Xresetty(), so one should probably use either savetty()/resetty() or the new
  93. Xfunctions only - and not mix the both ways unless one really knows what one
  94. Xdoes.
  95. X
  96. X  Diff lists vs v.1.0 are no longer included in the distribution. The make
  97. Xutility still is. PCcurses v.1.2 still compiles with MicroSoft 'C' v.4.0,
  98. Xand with Borland Turbo 'C' v.1.0. There is as far as I know no reason to be-
  99. Xlieve that it does not compile under MicroSoft 'C' v.3.0 and 5.x, or Turbo-
  100. X'C' v.1.5, but this has not been tested.
  101. X
  102. X  There are two makefile's included, one for MicroSoft 'C', one for Turbo-'C'.
  103. XThey are both copies of my personal makefile's, and as such they reflect the
  104. Xdirectory structure on my own computer. This will have to be changed before
  105. Xyou run make. Check $(INCDIR) and $(LIBDIR) in particular, and make the choice
  106. Xof ASM or 'C' cursesio version as mentioned above (the distribution version
  107. Xuses the 'C version of cursesio).
  108. X
  109. X  The manual file (curses.man) has been changed at appropriate places.
  110. X
  111. X  I would like to thank the following persons for their help:
  112. X
  113. X      Brandon S. Allbery (alberry@ncoast.UUCP)
  114. X        for running comp.binaries.ibm.pc (at that time)
  115. X        and comp.source.misc.
  116. X
  117. X    Steve Balogh (Steve@cit5.cit.oz.AU)
  118. X          for writing a set of manual pages and posting
  119. X        them to the net.
  120. X
  121. X    Torbjorn Lindh
  122. X        for finding bugs and suggesting raw
  123. X        character output routines.
  124. X
  125. X    Nathan Glasser (nathan@eddie.mit.edu)
  126. X          for finding and reporting bugs.
  127. X
  128. X    Ingvar Olafsson (...enea!hafro!ingvar)
  129. X          for finding and reporting bugs.
  130. X
  131. X    Eric Rosco (...enea!ipmoea!ericr)
  132. X          for finding and reporting bugs.
  133. X
  134. X    Steve Creps (creps@silver.bacs.indiana.edu)
  135. X          for doing a lot of work - among others
  136. X        posting bug fixes to the net, and writing
  137. X        the new cursesio.c module.
  138. X
  139. X    N. Dean Pentcheff (dean@violet.berkeley.edu)
  140. X          for finding bugs and rewriting cursesio.asm
  141. X        for Turbo 'C' 1.5.
  142. X
  143. X  Finally, Jeff Dean (parcvax,hplabs}!cdp!jeff)
  144. X               (jeff@ads.arpa)
  145. X    has had a shareware version of curses deliverable since
  146. X    about half a year before I released PCcurses 1.0 on Use-
  147. X    Net. He is very concerned about confusion between the two
  148. X    packages, and therefore any references on the network
  149. X    should make clear whether they reference Dean's PCcurses
  150. X    or Larsson's PCcurses.
  151. X
  152. X               PCCURSES v.1.1 Release Notes - 880306
  153. X    ===================================================
  154. X
  155. X  This is the release note for the second version of PCcurses, v.1.1.
  156. XBelow this note, the release note for v.1.0 is included. Read that first.
  157. XThe changes from v.1.0 to v.1.1 are minor. There are a few bug fixes, and
  158. Xnew (non-portable) functions for verbatim IBM character font display have
  159. Xbeen added (in charadd.c and charins.c). The manual file (curses.man) has
  160. Xbeen changed at appropriate places.
  161. X
  162. X  In the file v10tov11.dif there are listings of the differencies between
  163. Xversion 1.0 and 1.1. The diff listings are in UNIX diff(1) format.
  164. X
  165. X  Version 1.1 compiles with Turbo 'C' v.1.0, as well as MicroSoft 'C' v.3.0
  166. Xand v.4.0. On the release disk there is a make.exe utility which is very simi-
  167. Xlar to UNIX make (If the package was mailed to you, the make utility will be
  168. Xin uuencoded format - in make.uu - and must be uudecoded first). It is much
  169. Xmore powerful than MicroSoft's different MAKE'S; the latter ones will NOT ge-
  170. Xnerate libraries properly if used with the PCcurses makefiles.
  171. X
  172. X  There are three makefiles:
  173. X
  174. X    makefile        generic MSC 3.0 makefile
  175. X    makefile.ms        MSC 4.0 makefile
  176. X    makefile.tc        Turbo 'C' 1.0 makefile
  177. X
  178. X  To make a library with for example Turbo 'C', make directories to hold .H
  179. Xand .LIB files (these directories are the 'standard places'), edit makefile.tc
  180. Xfor this, and type
  181. X
  182. X    make -f makefile.tc all
  183. X
  184. Xand libraries for all memory models will be created in the .LIB directory,
  185. Xwhile the include files will end up in the .H directory. Also read what is
  186. Xsaid about installation below!
  187. X
  188. X
  189. X
  190. X
  191. X               PCCURSES v.1.0 Release Notes - 870824
  192. X    ===================================================
  193. X
  194. X
  195. X
  196. X  This is the release notes for the PCcurses v.1.0 cursor/window control
  197. Xpackage. PCcurses offers the functionality of UNIX curses, plus some
  198. Xextras. Normally it should be possible to port curses-based programs from
  199. XUNIX curses to PCcurses on the IBM PC without changes. PCcurses is a port/
  200. Xrewrite of Pavel Curtis' public domain 'ncurses' package. All the code has
  201. Xbeen re-written - it is not just an edit of ncurses (or UNIX curses). I
  202. Xmention this to clarify any copyright violation claims. The data struc-
  203. Xtures and ideas are very similar to ncurses. As for UNIX curses, I have
  204. Xnot even seen any sources for it.
  205. X
  206. X For an introduction to the use of 'curses' and it's derivatives, you
  207. Xshould read 'Screen Updating and Cursor Movement Optimization: A Library
  208. XPackage' by Kenneth C. R. C. Arnold, which describes the original Berkely
  209. XUNIX version of curses. It is available as part of the UNIX manuals. The
  210. Xother source of information is 'The Ncurses Reference Manual' by Pavel
  211. XCurtis. The latter is part of Curtis' ncurses package.
  212. X
  213. X  The only other documentation provided is a 'man' page which describes
  214. Xall the included functions in a very terse way. In the sources, each
  215. Xfunction is preceded by a rather thourough description of what the
  216. Xfunction does. I didn't have time to write a nice manual/tutorial - sorry.
  217. X
  218. X  PCcurses is released as a number of source files, a man page, and a make
  219. Xfile. A uuencoded copy of a 'make' utility, and a manpage for the 'make' is
  220. Xalso provided to make it easier to put together PCcurses libraries. Even if
  221. Xyou are not interested in PCcurses, it may be worthwhile to grab the make.
  222. X
  223. X  The makefile assumes the presence of the MicroSoft 'C' compiler (3.0 or
  224. X4.0), MicroSoft MASM and LIB, plus some MS-DOS utilities. The reason for
  225. Xsupplying MAKE.EXE is that the MicroSoft 'MAKE:s' are much inferior to a
  226. Xreal UNIX make. The supplied make is a port of a public domain make, pub-
  227. Xlished on UseNet. It is almost completely compatible with UNIX make. When
  228. Xgenerating the curses libraries, the makefile will direct make to do some
  229. Xdirectory creating and file copying, and then re-invoke itself with new
  230. Xtargets. The workings of the makefile are not absolutely crystal clear at
  231. Xfirst sight... just start it and see what it does.
  232. X
  233. X  For portability, the curses libraries depend on one assembler file for
  234. Xaccess to the BIOS routines. There is no support for the EGA, but both
  235. XCGA, MGA, and the HGA can be used. The libraries are originally for Micro-
  236. XSoft 'C', but all C modules should be portable right away. In the assembler
  237. Xfile, segment names probably need to be changed, and possibly the parameter
  238. Xpassing scheme. I think Turbo C will work right away - as far as I under-
  239. Xstand, all it's conventions are compatible with MicroSoft C.
  240. X
  241. X  There are some parts left out between ncurses and PCcurses. One is the
  242. Xsupport for multiple terminals - not very interesting on a PC anyway. Be-
  243. Xcause we KNOW what terminal we have, there is no need for a termcap or
  244. Xtermio library. PCcurses also has some things that neither curses nor
  245. Xncurses have. Compared to the original UNIX curses, PCcurses has lots
  246. Xof extras.
  247. X
  248. X  The BIOS routines are used directly, which gives fast screen updates.
  249. XPCcurses does not do direct writes to screen RAM - in my opinion it is
  250. Xa bit ugly to rely that much on hardware compatibility. Anyone could fix
  251. Xthat, of course...
  252. X
  253. X  One of the more serious problems with PCcurses is the way in which nor-
  254. Xmal, cbreak, and raw input modes are done. All those details are in the
  255. X'charget' module - I do raw I/O via the BIOS, and perform any buffering
  256. Xmyself. If an application program uses PCcurses, it should do ALL it's
  257. XI/O via PCcurses calls, otherwise the mix of normal and PCcurses I/O may
  258. Xmess up the display. I think my code is reasonable... comments are welcome,
  259. Xprovided you express them nicely...
  260. X
  261. X  To install, copy all files to a work directory, edit 'makefile' to define
  262. Xthe standard include and library file directory names of your choice (these
  263. Xdirectories must exist already, and their path names must be relative to the
  264. Xroot directory, not to the current one). You must also run uudecode on
  265. Xmake.uu, to generate MAKE.EXE. You can do that on your PC, if you have
  266. Xuudecode there, otherwise you can do it under UNIX and do a binary transfer
  267. Xto the PC. When you have MAKE.EXE in your work directory (or in your /bin
  268. Xdirectory), type make.
  269. X
  270. X  Make will now create 4 sub-directories (one for each memory model), copy
  271. Xsome assembler include files into them, copy two include files to your
  272. Xinclude directory, CHDIR to each sub-directory and re-invoke itself with
  273. Xother make targets to compile and assemble all the source files into the
  274. Xappropriate directories. Then the library manager is run to create the
  275. Xlibrary files in your desired library directory. Presto!
  276. X
  277. X  If you only want to generate a library for one memory model, type 'make
  278. Xsmall', 'make large', etc. The name of the memory model must be in lower
  279. Xcase, like in the makefile.
  280. X
  281. X  I think the package is fairly well debugged - but then again, that's
  282. Xwhat I always think. It was completed in May-87, and no problems found
  283. Xyet. Now it's your turn... Comments, suggestions and bug reports and
  284. Xfixes (no flames please) to
  285. X
  286. XBjorn Larsson
  287. XINFOVOX AB
  288. XBox 2503                (...seismo!mcvax!enea!infovax!bl)
  289. XS-171 02 Solna
  290. XSWEDEN
  291. END_OF_FILE
  292. if test 12183 -ne `wc -c <'README.NOW'`; then
  293.     echo shar: \"'README.NOW'\" unpacked with wrong size!
  294. fi
  295. # end of 'README.NOW'
  296. fi
  297. if test -f 'beep.c' -a "${1}" != "-c" ; then 
  298.   echo shar: Will not clobber existing file \"'beep.c'\"
  299. else
  300. echo shar: Extracting \"'beep.c'\" \(1500 characters\)
  301. sed "s/^X//" >'beep.c' <<'END_OF_FILE'
  302. X/****************************************************************/
  303. X/*                                */
  304. X/* Beep() and flash() routines of the PCcurses package        */
  305. X/*                                */
  306. X/****************************************************************/
  307. X/* This version of curses is based on ncurses, a curses version    */
  308. X/* originally written by Pavel Curtis at Cornell University.    */
  309. X/* I have made substantial changes to make it run on IBM PC's,    */
  310. X/* and therefore consider myself free to make it public domain.    */
  311. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  312. X/****************************************************************/
  313. X/* 1.0:    Release:                    870515    */
  314. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  315. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  316. X/****************************************************************/
  317. X
  318. X#include <curses.h>
  319. X#include <curspriv.h>
  320. X
  321. Xchar _curses_beep_rcsid[] = "@(#)beep.c v1.3 - 881005";
  322. X
  323. X/****************************************************************/
  324. X/* Beep() sounds the terminal bell.                */
  325. X/****************************************************************/
  326. X
  327. Xvoid    beep()
  328. X  {
  329. X  _cursesputc('\007',0);
  330. X  } /* beep */
  331. X
  332. X/****************************************************************/
  333. X/* Flash() flashes the terminal screen.                */
  334. X/****************************************************************/
  335. X
  336. Xvoid    flash()
  337. X  {
  338. X  int i;
  339. X
  340. X  _cursesscroll(0,0,LINES-1,COLS-1,0,0x70);
  341. X  for (i=0;i<10000;)
  342. X    i++;
  343. X  _cursesscroll(0,0,LINES-1,COLS-1,0,0x0);
  344. X  wrefresh(curscr);
  345. X  } /* flash */
  346. END_OF_FILE
  347. if test 1500 -ne `wc -c <'beep.c'`; then
  348.     echo shar: \"'beep.c'\" unpacked with wrong size!
  349. fi
  350. # end of 'beep.c'
  351. fi
  352. if test -f 'border.c' -a "${1}" != "-c" ; then 
  353.   echo shar: Will not clobber existing file \"'border.c'\"
  354. else
  355. echo shar: Extracting \"'border.c'\" \(2207 characters\)
  356. sed "s/^X//" >'border.c' <<'END_OF_FILE'
  357. X/****************************************************************/
  358. X/* Box border control routines of the PCcurses package.        */
  359. X/*                                */
  360. X/****************************************************************/
  361. X/* This version of curses is based on ncurses, a curses version    */
  362. X/* originally written by Pavel Curtis at Cornell University.    */
  363. X/* I have made substantial changes to make it run on IBM PC's,    */
  364. X/* and therefore consider myself free make it public domain.    */
  365. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  366. X/****************************************************************/
  367. X/* 1.3:    Released:                    881005    */
  368. X/****************************************************************/
  369. X
  370. X#include <curses.h>
  371. X#include <curspriv.h>
  372. X
  373. Xchar _curses_border_rcsid[] = "@(#)border.c v1.3 - 881005";
  374. X
  375. X/****************************************************************/
  376. X/* Wborder() sets the border characters in window win.        */ 
  377. X/****************************************************************/
  378. X
  379. Xvoid wborder(win, l, r, t, b, tl, tr, bl, br)
  380. X  WINDOW    *win;
  381. X  int         l;
  382. X  int         r;
  383. X  int         t;
  384. X  int         b;
  385. X  int         tl;
  386. X  int         tr;
  387. X  int         bl;
  388. X  int         br;
  389. X  {
  390. X  win->_borderchars[0] = (char) l;
  391. X  win->_borderchars[1] = (char) r;
  392. X  win->_borderchars[2] = (char) t;
  393. X  win->_borderchars[3] = (char) b;
  394. X  win->_borderchars[4] = (char) tl;
  395. X  win->_borderchars[5] = (char) tr;
  396. X  win->_borderchars[6] = (char) bl;
  397. X  win->_borderchars[7] = (char) br;
  398. X  } /* wborder */
  399. X
  400. X/****************************************************************/
  401. X/* Border() sets the border characters in the stdscr window.    */ 
  402. X/* Don't make this a call to wborder() - it would require soo    */
  403. X/* much stack for parameters...                    */
  404. X/****************************************************************/
  405. X
  406. Xvoid border(l, r, t, b, tl, tr, bl, br)
  407. X  int         l;
  408. X  int         r;
  409. X  int         t;
  410. X  int         b;
  411. X  int         tl;
  412. X  int         tr;
  413. X  int         bl;
  414. X  int         br;
  415. X  {
  416. X  stdscr->_borderchars[0] = (char) l;
  417. X  stdscr->_borderchars[1] = (char) r;
  418. X  stdscr->_borderchars[2] = (char) t;
  419. X  stdscr->_borderchars[3] = (char) b;
  420. X  stdscr->_borderchars[4] = (char) tl;
  421. X  stdscr->_borderchars[5] = (char) tr;
  422. X  stdscr->_borderchars[6] = (char) bl;
  423. X  stdscr->_borderchars[7] = (char) br;
  424. X  } /* border */
  425. END_OF_FILE
  426. if test 2207 -ne `wc -c <'border.c'`; then
  427.     echo shar: \"'border.c'\" unpacked with wrong size!
  428. fi
  429. # end of 'border.c'
  430. fi
  431. if test -f 'charpick.c' -a "${1}" != "-c" ; then 
  432.   echo shar: Will not clobber existing file \"'charpick.c'\"
  433. else
  434. echo shar: Extracting \"'charpick.c'\" \(2393 characters\)
  435. sed "s/^X//" >'charpick.c' <<'END_OF_FILE'
  436. X/****************************************************************/
  437. X/* Winch() routine of the PCcurses package            */
  438. X/*                                */
  439. X/****************************************************************/
  440. X/* This version of curses is based on ncurses, a curses version    */
  441. X/* originally written by Pavel Curtis at Cornell University.    */
  442. X/* I have made substantial changes to make it run on IBM PC's,    */
  443. X/* and therefore consider myself free to make it public domain.    */
  444. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  445. X/****************************************************************/
  446. X/* 1.0:    Release:                    870515    */
  447. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  448. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  449. X/****************************************************************/
  450. X
  451. X#include <curses.h>
  452. X#include <curspriv.h>
  453. X
  454. Xchar _curses_charpick_rcsid[] = "@(#)charpick.c v1.3 - 881005";
  455. X
  456. X/****************************************************************/
  457. X/* Winch(win) returns the character at the current position in    */
  458. X/* window 'win'.                        */
  459. X/****************************************************************/
  460. X
  461. Xint    winch(win)
  462. X  WINDOW    *win;
  463. X  {
  464. X  return((win->_line[win->_cury][win->_curx]) & 0xff);
  465. X  } /* winch */
  466. X
  467. X/****************************************************************/
  468. X/* Inch() returns the character at the current cursor position    */
  469. X/* in stdscr.                            */
  470. X/****************************************************************/
  471. X
  472. Xint inch()
  473. X  {
  474. X  return((stdscr->_line[stdscr->_cury][stdscr->_curx]) & 0xff);
  475. X  } /* inch */
  476. X
  477. X/****************************************************************/
  478. X/* Mvinch() moves the stdscr cursor to a new position, then    */
  479. X/* returns the character at that position.            */
  480. X/****************************************************************/
  481. X
  482. Xint mvinch(y,x)
  483. X  int  y;
  484. X  int  x;
  485. X  {
  486. X  if (wmove(stdscr,y,x) == ERR)
  487. X    return(ERR);
  488. X  return((stdscr->_line[stdscr->_cury][stdscr->_curx]) & 0xff);
  489. X  } /* mvinch */
  490. X
  491. X/****************************************************************/
  492. X/* Mvwinch() moves the cursor of window 'win' to a new posi-    */
  493. X/* tion, then returns the character at that position.        */
  494. X/****************************************************************/
  495. X
  496. Xint mvwinch(win,y,x)
  497. X  WINDOW *win;
  498. X  int  y;
  499. X  int  x;
  500. X  {
  501. X  if (wmove(win,y,x) == ERR)
  502. X    return(ERR);
  503. X  return((win->_line[win->_cury][win->_curx]) & 0xff);
  504. X  } /* mvwinch */
  505. END_OF_FILE
  506. if test 2393 -ne `wc -c <'charpick.c'`; then
  507.     echo shar: \"'charpick.c'\" unpacked with wrong size!
  508. fi
  509. # end of 'charpick.c'
  510. fi
  511. if test -f 'curses.cmd' -a "${1}" != "-c" ; then 
  512.   echo shar: Will not clobber existing file \"'curses.cmd'\"
  513. else
  514. echo shar: Extracting \"'curses.cmd'\" \(632 characters\)
  515. sed "s/^X//" >'curses.cmd' <<'END_OF_FILE'
  516. Xtmp
  517. Xy
  518. Xattrib.obj    &
  519. X+beep.obj     &
  520. X+border.obj   &
  521. X+boxes.obj    &
  522. X+charadd.obj  &
  523. X+chardel.obj  &
  524. X+charget.obj  &
  525. X+charins.obj  &
  526. X+charpick.obj &
  527. X+clrtobot.obj &
  528. X+clrtoeol.obj &
  529. X+cursesio.obj &
  530. X+endwin.obj   &
  531. X+initscr.obj  &
  532. X+linedel.obj  &
  533. X+lineins.obj  &
  534. X+longname.obj &
  535. X+move.obj     &
  536. X+mvcursor     &
  537. X+newwin.obj   &
  538. X+options.obj  &
  539. X+overlay.obj  &
  540. X+prntscan.obj &
  541. X+refresh.obj  &
  542. X+scrreg.obj   &
  543. X+setmode.obj  &
  544. X+setterm.obj  &
  545. X+stradd.obj   &
  546. X+strget.obj   &
  547. X+tabsize.obj  &
  548. X+termmisc.obj &
  549. X+unctrl.obj   &
  550. X+update.obj   &
  551. X+winclear.obj &
  552. X+windel.obj   &
  553. X+winerase.obj &
  554. X+winmove.obj  &
  555. X+winscrol.obj &
  556. X+wintouch.obj
  557. Xnul
  558. END_OF_FILE
  559. if test 632 -ne `wc -c <'curses.cmd'`; then
  560.     echo shar: \"'curses.cmd'\" unpacked with wrong size!
  561. fi
  562. # end of 'curses.cmd'
  563. fi
  564. if test -f 'endwin.c' -a "${1}" != "-c" ; then 
  565.   echo shar: Will not clobber existing file \"'endwin.c'\"
  566. else
  567. echo shar: Extracting \"'endwin.c'\" \(1514 characters\)
  568. sed "s/^X//" >'endwin.c' <<'END_OF_FILE'
  569. X/****************************************************************/
  570. X/* Endwin() routine of the PCcurses package            */
  571. X/*                                */
  572. X/****************************************************************/
  573. X/* This version of curses is based on ncurses, a curses version    */
  574. X/* originally written by Pavel Curtis at Cornell University.    */
  575. X/* I have made substantial changes to make it run on IBM PC's,    */
  576. X/* and therefore consider myself free to make it public domain.    */
  577. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  578. X/****************************************************************/
  579. X/* 1.0:    Release:                    870515    */
  580. X/* 1.2:    Changed call sequence to cursesio.[c,asm], Thanks    */
  581. X/*    to S. Creps. Rcsid[] string for maintenance:    881002    */
  582. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  583. X/****************************************************************/
  584. X
  585. X#include <curses.h>
  586. X#include <curspriv.h>
  587. X
  588. Xchar _curses_endwin_rcsid[] = "@(#)endwin.c v1.3 - 881005";
  589. X
  590. X/****************************************************************/
  591. X/* Endwin() does necessary clean-up after using the PCcurses    */
  592. X/* package. It should be called before exiting the user's pro-    */
  593. X/* gram.                            */
  594. X/****************************************************************/
  595. X
  596. Xint endwin()
  597. X  {
  598. X  delwin(stdscr);
  599. X  delwin(curscr);
  600. X  delwin(_cursvar.tmpwin);
  601. X  curson();                /* turn on cursor if off */
  602. X  _cursescursor(LINES-1, 0);        /* put at lower left */
  603. X  _cursesscb(_cursvar.orgcbr);        /* restore original ^BREAK setting */
  604. X  return(OK);
  605. X  } /* endwin */
  606. END_OF_FILE
  607. if test 1514 -ne `wc -c <'endwin.c'`; then
  608.     echo shar: \"'endwin.c'\" unpacked with wrong size!
  609. fi
  610. # end of 'endwin.c'
  611. fi
  612. if test -f 'farcall.inc' -a "${1}" != "-c" ; then 
  613.   echo shar: Will not clobber existing file \"'farcall.inc'\"
  614. else
  615. echo shar: Extracting \"'farcall.inc'\" \(16 characters\)
  616. sed "s/^X//" >'farcall.inc' <<'END_OF_FILE'
  617. X    far_call EQU    1
  618. END_OF_FILE
  619. if test 16 -ne `wc -c <'farcall.inc'`; then
  620.     echo shar: \"'farcall.inc'\" unpacked with wrong size!
  621. fi
  622. # end of 'farcall.inc'
  623. fi
  624. if test -f 'hugedata.inc' -a "${1}" != "-c" ; then 
  625.   echo shar: Will not clobber existing file \"'hugedata.inc'\"
  626. else
  627. echo shar: Extracting \"'hugedata.inc'\" \(17 characters\)
  628. sed "s/^X//" >'hugedata.inc' <<'END_OF_FILE'
  629. X    huge_data EQU    1
  630. END_OF_FILE
  631. if test 17 -ne `wc -c <'hugedata.inc'`; then
  632.     echo shar: \"'hugedata.inc'\" unpacked with wrong size!
  633. fi
  634. # end of 'hugedata.inc'
  635. fi
  636. if test -f 'initscr.c' -a "${1}" != "-c" ; then 
  637.   echo shar: Will not clobber existing file \"'initscr.c'\"
  638. else
  639. echo shar: Extracting \"'initscr.c'\" \(2346 characters\)
  640. sed "s/^X//" >'initscr.c' <<'END_OF_FILE'
  641. X/****************************************************************/
  642. X/* Initscr() routine of the PCcurses package            */
  643. X/*                                */
  644. X/****************************************************************/
  645. X/* This version of curses is based on ncurses, a curses version    */
  646. X/* originally written by Pavel Curtis at Cornell University.    */
  647. X/* I have made substantial changes to make it run on IBM PC's,    */
  648. X/* and therefore consider myself free to make it public domain.    */
  649. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  650. X/****************************************************************/
  651. X/* 1.0:    Release:                    870515    */
  652. X/* 1.1:    Revision string in the code:            880306    */
  653. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  654. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  655. X/****************************************************************/
  656. X
  657. X#include <curses.h>
  658. X#include <curspriv.h>
  659. X
  660. Xchar _curses_initscr_rcsid[] = "@(#)initscr.c v1.3 - 881005";
  661. Xchar _curses_revcod[] =  CURSES_RCS_ID;
  662. Xchar _curses_cpyrgt[] = "Author B. Larsson - Public Domain";
  663. X
  664. Xextern    void    exit();        /* to avoid warings */
  665. X
  666. XWINDOW *curscr;            /* the current screen image */
  667. XWINDOW *stdscr;            /* the default screen window */
  668. Xcursv   _cursvar;        /* curses variables */
  669. Xint    LINES;            /* terminal height */
  670. Xint    COLS;            /* terminal width */
  671. X
  672. X/****************************************************************/
  673. X/* Initscr() does necessary initializations for the PCcurses    */
  674. X/* package. It MUST be called before any other curses routines.    */
  675. X/****************************************************************/
  676. X
  677. Xint initscr()
  678. X  {
  679. X  _cursvar.cursrow   = -1;        /* Initial cursor unknown */
  680. X  _cursvar.curscol   = -1;
  681. X  _cursvar.autocr    = TRUE;        /* lf -> crlf by default */
  682. X  _cursvar.raw       = FALSE;        /* tty I/O modes */
  683. X  _cursvar.cbreak    = FALSE;
  684. X  _cursvar.echo      = TRUE;
  685. X  _cursvar.refrbrk   = FALSE;        /* no premature end of refresh */
  686. X  _cursvar.orgcbr    = (bool)_cursesgcb();/* original ^BREAK setting */
  687. X
  688. X  LINES              = 25;        /* @@@@ this must be fixed */
  689. X  COLS               = _cursesgcols();
  690. X
  691. X  if ((_cursvar.tmpwin = newwin(LINES,COLS,0,0)) == (WINDOW *)ERR)
  692. X    exit(1);
  693. X  if ((curscr = newwin(LINES,COLS,0,0)) == (WINDOW *)ERR)
  694. X    exit(1);
  695. X  if ((stdscr = newwin(LINES,COLS,0,0)) == (WINDOW *)ERR)
  696. X    exit(1);
  697. X  curscr->_clear = FALSE;
  698. X  return(OK);
  699. X  } /* initscr */
  700. END_OF_FILE
  701. if test 2346 -ne `wc -c <'initscr.c'`; then
  702.     echo shar: \"'initscr.c'\" unpacked with wrong size!
  703. fi
  704. # end of 'initscr.c'
  705. fi
  706. if test -f 'longname.c' -a "${1}" != "-c" ; then 
  707.   echo shar: Will not clobber existing file \"'longname.c'\"
  708. else
  709. echo shar: Extracting \"'longname.c'\" \(1179 characters\)
  710. sed "s/^X//" >'longname.c' <<'END_OF_FILE'
  711. X/****************************************************************/
  712. X/* Longname() routine of the PCcurses package            */
  713. X/*                                */
  714. X/****************************************************************/
  715. X/* This version of curses is based on ncurses, a curses version    */
  716. X/* originally written by Pavel Curtis at Cornell University.    */
  717. X/* I have made substantial changes to make it run on IBM PC's,    */
  718. X/* and therefore consider myself free to make it public domain.    */
  719. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  720. X/****************************************************************/
  721. X/* 1.0:    Release:                    870515    */
  722. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  723. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  724. X/****************************************************************/
  725. X
  726. X#include <curses.h>
  727. X#include <curspriv.h>
  728. X
  729. Xchar _curses_longname_rcsid[] = "@(#)longname.c v1.3 - 881005";
  730. X
  731. X/****************************************************************/
  732. X/* Longname() returns a pointer to a string describing the    */
  733. X/* user terminal.                        */
  734. X/****************************************************************/
  735. X
  736. Xchar *longname()
  737. X  {
  738. X  return("IBM PC BIOS");
  739. X  }/* longname */
  740. END_OF_FILE
  741. if test 1179 -ne `wc -c <'longname.c'`; then
  742.     echo shar: \"'longname.c'\" unpacked with wrong size!
  743. fi
  744. # end of 'longname.c'
  745. fi
  746. if test -f 'move.c' -a "${1}" != "-c" ; then 
  747.   echo shar: Will not clobber existing file \"'move.c'\"
  748. else
  749. echo shar: Extracting \"'move.c'\" \(1591 characters\)
  750. sed "s/^X//" >'move.c' <<'END_OF_FILE'
  751. X/****************************************************************/
  752. X/* Wmove() routine of the PCcurses package            */
  753. X/*                                */
  754. X/****************************************************************/
  755. X/* This version of curses is based on ncurses, a curses version    */
  756. X/* originally written by Pavel Curtis at Cornell University.    */
  757. X/* I have made substantial changes to make it run on IBM PC's,    */
  758. X/* and therefore consider myself free to make it public domain.    */
  759. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  760. X/****************************************************************/
  761. X/* 1.0:    Release:                    870515    */
  762. X/* 1.2:    Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  763. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  764. X/****************************************************************/
  765. X
  766. X#include <curses.h>
  767. X#include <curspriv.h>
  768. X
  769. Xchar _curses_move_rcsid[] = "@(#)move.c v1.3 - 881005";
  770. X
  771. X/****************************************************************/
  772. X/* Wmove() moves the cursor in window 'win' to position (x,y).    */
  773. X/****************************************************************/
  774. X
  775. Xint    wmove(win,y,x)
  776. X  WINDOW    *win;
  777. X  int         y;
  778. X  int         x;
  779. X  {
  780. X  if ((x < 0)||(x >= win->_maxx)||(y < win->_regtop)||(y > win->_regbottom))
  781. X    return(ERR);
  782. X  win->_curx = x;
  783. X  win->_cury = y;
  784. X  return(OK);
  785. X  } /* wmove */
  786. X
  787. X/****************************************************************/
  788. X/* Move() moves the cursor in stdscr to position (x,y).        */
  789. X/****************************************************************/
  790. X
  791. Xint move(y,x)
  792. X  int y;
  793. X  int x;
  794. X  {
  795. X  return(wmove(stdscr,y,x));
  796. X  } /* move */
  797. END_OF_FILE
  798. if test 1591 -ne `wc -c <'move.c'`; then
  799.     echo shar: \"'move.c'\" unpacked with wrong size!
  800. fi
  801. # end of 'move.c'
  802. fi
  803. if test -f 'mvcursor.c' -a "${1}" != "-c" ; then 
  804.   echo shar: Will not clobber existing file \"'mvcursor.c'\"
  805. else
  806. echo shar: Extracting \"'mvcursor.c'\" \(1439 characters\)
  807. sed "s/^X//" >'mvcursor.c' <<'END_OF_FILE'
  808. X/****************************************************************/
  809. X/* Mvcur() routine of the PCcurses package            */
  810. X/*                                */
  811. X/****************************************************************/
  812. X/* This version of curses is based on ncurses, a curses version    */
  813. X/* originally written by Pavel Curtis at Cornell University.    */
  814. X/* I have made substantial changes to make it run on IBM PC's,    */
  815. X/* and therefore consider myself free to make it public domain.    */
  816. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  817. X/****************************************************************/
  818. X/* 1.0:    Release:                    870515    */
  819. X/* 1.2:    Changed call sequence to cursesio.[c,asm], Thanks    */
  820. X/*    to S. Creps. Rcsid[] string for maintenance:    881002    */
  821. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  822. X/****************************************************************/
  823. X
  824. X#include <curses.h>
  825. X#include <curspriv.h>
  826. X
  827. Xchar _curses_mvcursor_rcsid[] = "@(#)mvcursor.c v1.3 - 881005";
  828. X
  829. X/****************************************************************/
  830. X/* Mvcur(oldy,oldx,newy,newx) the display cursor to <newy,newx>    */
  831. X/****************************************************************/
  832. X
  833. Xint    mvcur(oldy,oldx,newy,newx)
  834. X  int oldy;
  835. X  int oldx;
  836. X  int newy;
  837. X  int newx;
  838. X  {
  839. X  if ((newy >= LINES) || (newx >= COLS) || (newy < 0) || (newx < 0))
  840. X    return(ERR);
  841. X  _cursescursor(newy,newx);
  842. X  _cursvar.cursrow = newy;
  843. X  _cursvar.curscol = newx;
  844. X  return(OK);
  845. X  } /* mvcur */
  846. END_OF_FILE
  847. if test 1439 -ne `wc -c <'mvcursor.c'`; then
  848.     echo shar: \"'mvcursor.c'\" unpacked with wrong size!
  849. fi
  850. # end of 'mvcursor.c'
  851. fi
  852. if test -f 'nearcall.inc' -a "${1}" != "-c" ; then 
  853.   echo shar: Will not clobber existing file \"'nearcall.inc'\"
  854. else
  855. echo shar: Extracting \"'nearcall.inc'\" \(16 characters\)
  856. sed "s/^X//" >'nearcall.inc' <<'END_OF_FILE'
  857. X    far_call EQU    0
  858. END_OF_FILE
  859. if test 16 -ne `wc -c <'nearcall.inc'`; then
  860.     echo shar: \"'nearcall.inc'\" unpacked with wrong size!
  861. fi
  862. # end of 'nearcall.inc'
  863. fi
  864. if test -f 'scrreg.c' -a "${1}" != "-c" ; then 
  865.   echo shar: Will not clobber existing file \"'scrreg.c'\"
  866. else
  867. echo shar: Extracting \"'scrreg.c'\" \(1843 characters\)
  868. sed "s/^X//" >'scrreg.c' <<'END_OF_FILE'
  869. X/****************************************************************/
  870. X/* Wsetscrreg() routine of the PCcurses package            */
  871. X/*                                */
  872. X/****************************************************************/
  873. X/* This version of curses is based on ncurses, a curses version    */
  874. X/* originally written by Pavel Curtis at Cornell University.    */
  875. X/* I have made substantial changes to make it run on IBM PC's,    */
  876. X/* and therefore consider myself free to make it public domain.    */
  877. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  878. X/****************************************************************/
  879. X/* 1.0:    Release:                    870515    */
  880. X/* 1.2:    Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  881. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  882. X/****************************************************************/
  883. X
  884. X#include <curses.h>
  885. X#include <curspriv.h>
  886. X
  887. Xchar _curses_scrreg_rcsid[] = "@(#)scrreg.c v1.3 - 881005";
  888. X
  889. X/****************************************************************/
  890. X/* Wsetscrreg() set the scrolling region of window 'win' to in-    */
  891. X/* clude all lines between 'top' and 'bottom'.            */
  892. X/****************************************************************/
  893. X
  894. Xint wsetscrreg(win, top, bottom)
  895. X  WINDOW    *win;
  896. X  int         top;
  897. X  int         bottom;
  898. X  {
  899. X  if (  (0 <= top)
  900. X    &&
  901. X    (top <= win->_cury)
  902. X    &&
  903. X    (win->_cury <= bottom)
  904. X    &&
  905. X    (bottom < win->_maxy)
  906. X     )
  907. X    {
  908. X    win->_regtop = top;
  909. X    win->_regbottom = bottom;
  910. X    return(OK);
  911. X    } /* if */
  912. X  else
  913. X    return(ERR);
  914. X  } /* wsetscrreg */
  915. X
  916. X/****************************************************************/
  917. X/* Setscrreg() set the scrolling region of stdscr to include    */
  918. X/* all lines between 'top' and 'bottom'.            */
  919. X/****************************************************************/
  920. X
  921. Xint setscrreg(top, bottom)
  922. X  int top;
  923. X  int bottom;
  924. X  {
  925. X  return(wsetscrreg(stdscr,top,bottom));
  926. X  } /* setscrreg */
  927. END_OF_FILE
  928. if test 1843 -ne `wc -c <'scrreg.c'`; then
  929.     echo shar: \"'scrreg.c'\" unpacked with wrong size!
  930. fi
  931. # end of 'scrreg.c'
  932. fi
  933. if test -f 'smaldata.inc' -a "${1}" != "-c" ; then 
  934.   echo shar: Will not clobber existing file \"'smaldata.inc'\"
  935. else
  936. echo shar: Extracting \"'smaldata.inc'\" \(17 characters\)
  937. sed "s/^X//" >'smaldata.inc' <<'END_OF_FILE'
  938. X    huge_data EQU    0
  939. END_OF_FILE
  940. if test 17 -ne `wc -c <'smaldata.inc'`; then
  941.     echo shar: \"'smaldata.inc'\" unpacked with wrong size!
  942. fi
  943. # end of 'smaldata.inc'
  944. fi
  945. if test -f 'stradd.c' -a "${1}" != "-c" ; then 
  946.   echo shar: Will not clobber existing file \"'stradd.c'\"
  947. else
  948. echo shar: Extracting \"'stradd.c'\" \(2666 characters\)
  949. sed "s/^X//" >'stradd.c' <<'END_OF_FILE'
  950. X/****************************************************************/
  951. X/* Addstr() routines of the PCcurses package            */
  952. X/*                                */
  953. X/****************************************************************/
  954. X/* This version of curses is based on ncurses, a curses version    */
  955. X/* originally written by Pavel Curtis at Cornell University.    */
  956. X/* I have made substantial changes to make it run on IBM PC's,    */
  957. X/* and therefore consider myself free to make it public domain.    */
  958. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  959. X/****************************************************************/
  960. X/* 1.0:    Release:                    870515    */
  961. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  962. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  963. X/****************************************************************/
  964. X
  965. X#include <curses.h>
  966. X#include <curspriv.h>
  967. X
  968. Xchar _curses_stradd_rcsid[] = "@(#)stradd.c v1.3 - 881005";
  969. X
  970. X/****************************************************************/
  971. X/* Waddstr() inserts string 'str' at the current cursor posi-    */
  972. X/* tion in window 'win', and takes any actions as dictated by    */
  973. X/* the characters.                        */
  974. X/****************************************************************/
  975. X
  976. Xint    waddstr(win, str)
  977. X  WINDOW    *win; 
  978. X  char        *str;
  979. X  {
  980. X  while (*str)
  981. X    {
  982. X    if (waddch(win, *str++) == ERR)
  983. X      return(ERR);
  984. X    }
  985. X  return(OK);
  986. X  } /* waddstr */
  987. X
  988. X/****************************************************************/
  989. X/* Addstr() inserts string 'str' at the current cursor posi-    */
  990. X/* tion in stdscr, and takes any actions as dictated by the    */
  991. X/* characters.                            */
  992. X/****************************************************************/
  993. X
  994. Xint addstr(str)
  995. X  char     *str;
  996. X  {
  997. X  return (waddstr(stdscr,str));
  998. X  } /* addstr */
  999. X
  1000. X/****************************************************************/
  1001. X/* Mvaddstr() move to a new position in stdscr, then inserts    */
  1002. X/* string 'str' at the new position, taking any actions as dic-    */
  1003. X/* tated by the characters.                    */
  1004. X/****************************************************************/
  1005. X
  1006. Xint mvaddstr(y,x,str)
  1007. X  int     y;
  1008. X  int     x;
  1009. X  char    *str;
  1010. X  {
  1011. X  if (wmove(stdscr,y,x) == ERR)
  1012. X    return (ERR);
  1013. X  return (waddstr(stdscr,str));
  1014. X  } /* mvaddstr */
  1015. X
  1016. X/****************************************************************/
  1017. X/* Mvwaddstr() move to a new position in window 'win', then    */
  1018. X/* inserts string 'str' at the new position, taking any actions    */
  1019. X/* as dictated by the characters.                */
  1020. X/****************************************************************/
  1021. X
  1022. Xint mvwaddstr(win,y,x,str)
  1023. X  WINDOW *win;
  1024. X  int      y;
  1025. X  int      x;
  1026. X  char   *str;
  1027. X  {
  1028. X  if (wmove(win,y,x) == ERR)
  1029. X    return (ERR);
  1030. X  return (waddstr(win,str));
  1031. X  } /* mvwaddstr */
  1032. END_OF_FILE
  1033. if test 2666 -ne `wc -c <'stradd.c'`; then
  1034.     echo shar: \"'stradd.c'\" unpacked with wrong size!
  1035. fi
  1036. # end of 'stradd.c'
  1037. fi
  1038. if test -f 'tabsize.c' -a "${1}" != "-c" ; then 
  1039.   echo shar: Will not clobber existing file \"'tabsize.c'\"
  1040. else
  1041. echo shar: Extracting \"'tabsize.c'\" \(1662 characters\)
  1042. sed "s/^X//" >'tabsize.c' <<'END_OF_FILE'
  1043. X/****************************************************************/
  1044. X/* Tabsize() routines of the PCcurses package            */
  1045. X/*                                */
  1046. X/****************************************************************/
  1047. X/* This version of curses is based on ncurses, a curses version    */
  1048. X/* originally written by Pavel Curtis at Cornell University.    */
  1049. X/* I have made substantial changes to make it run on IBM PC's,    */
  1050. X/* and therefore consider myself free to make it public domain.    */
  1051. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1052. X/****************************************************************/
  1053. X/* 1.0:    Release:                    870515    */
  1054. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  1055. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1056. X/****************************************************************/
  1057. X
  1058. X#include <curses.h>
  1059. X#include <curspriv.h>
  1060. X
  1061. Xchar _curses_tabsize_rcsid[] = "@(#)tabsize.c v1.3 - 881005";
  1062. X
  1063. X/****************************************************************/
  1064. X/* Wtabsize(win,ts) sets the tabsize of window 'win' to 'ts',    */
  1065. X/* and returns the original value.                */
  1066. X/****************************************************************/
  1067. X
  1068. Xint    wtabsize(win,ts)
  1069. X  WINDOW    *win;
  1070. X  int         ts;
  1071. X  {
  1072. X  int         origval;
  1073. X
  1074. X  origval = win->_tabsize;
  1075. X  win->_tabsize = ts;
  1076. X  return(origval);
  1077. X  } /* wtabsize*/
  1078. X
  1079. X/****************************************************************/
  1080. X/* Tabsize(ts) sets the tabsize of stdscr to 'ts', and returns    */
  1081. X/* the original value.                        */
  1082. X/****************************************************************/
  1083. X
  1084. Xint    tabsize(ts)
  1085. X  int         ts;
  1086. X  {
  1087. X  int         origval;
  1088. X
  1089. X  origval = stdscr->_tabsize;
  1090. X  stdscr->_tabsize = ts;
  1091. X  return(origval);
  1092. X  } /* tabsize */
  1093. END_OF_FILE
  1094. if test 1662 -ne `wc -c <'tabsize.c'`; then
  1095.     echo shar: \"'tabsize.c'\" unpacked with wrong size!
  1096. fi
  1097. # end of 'tabsize.c'
  1098. fi
  1099. if test -f 'termmisc.c' -a "${1}" != "-c" ; then 
  1100.   echo shar: Will not clobber existing file \"'termmisc.c'\"
  1101. else
  1102. echo shar: Extracting \"'termmisc.c'\" \(2893 characters\)
  1103. sed "s/^X//" >'termmisc.c' <<'END_OF_FILE'
  1104. X/****************************************************************/
  1105. X/* Miscellaneous Terminal routines of the PCcurses package    */
  1106. X/*                                */
  1107. X/****************************************************************/
  1108. X/* This version of curses is based on ncurses, a curses version    */
  1109. X/* originally written by Pavel Curtis at Cornell University.    */
  1110. X/* I have made substantial changes to make it run on IBM PC's,    */
  1111. X/* and therefore consider myself free to make it public domain.    */
  1112. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1113. X/****************************************************************/
  1114. X/* 1.0:    Release:                    870515    */
  1115. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  1116. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1117. X/****************************************************************/
  1118. X
  1119. X#include <curses.h>
  1120. X#include <curspriv.h>
  1121. X
  1122. X/* static variables or saving terminal modes */
  1123. X
  1124. Xchar _curses_termmisc_rcsid[] = "@(#)termmisc.c v1.3 - 881005";
  1125. X
  1126. Xstatic bool savedacr;
  1127. Xstatic bool savedcbr;
  1128. Xstatic bool savedecho;
  1129. Xstatic bool savedraw;
  1130. X
  1131. X/****************************************************************/
  1132. X/* Fixterm(), resetterm(), saveoldterm, saveterm() gettmode(),    */
  1133. X/* setterm() and baudrate() function dummies for compatibility.    */
  1134. X/****************************************************************/
  1135. X
  1136. Xint fixterm()
  1137. X  {
  1138. X  return(OK);
  1139. X  } /* fixterm */
  1140. X
  1141. Xint resetterm()
  1142. X  {
  1143. X  return(OK);
  1144. X  }
  1145. X
  1146. Xint saveoldterm()
  1147. X  {
  1148. X  return(OK);
  1149. X  } /* saveoldterm */
  1150. X
  1151. Xint saveterm()
  1152. X  {
  1153. X  return(OK);
  1154. X  } /* saveterm */
  1155. X
  1156. Xint gettmode()
  1157. X  {
  1158. X  return(OK);
  1159. X  } /* gettmode */
  1160. X
  1161. Xint setterm()
  1162. X  {
  1163. X  return(OK);
  1164. X  } /* setterm */
  1165. X
  1166. Xint baudrate()
  1167. X  {
  1168. X  return(19200);
  1169. X  } /* baudrate */
  1170. X
  1171. X/****************************************************************/
  1172. X/* Erasechar(), killchar() returns std MSDOS erase chars.    */
  1173. X/****************************************************************/
  1174. X
  1175. Xint erasechar()
  1176. X  {
  1177. X  return(_DCCHAR);        /* character delete char */
  1178. X  } /* erasechar */
  1179. X
  1180. Xint killchar()
  1181. X  {
  1182. X  return(_DLCHAR);        /* line delete char */
  1183. X  } /* killchar */
  1184. X
  1185. X/****************************************************************/
  1186. X/* Savetty() and resetty() saves and restores the terminal I/O    */
  1187. X/* settings.                            */
  1188. X/****************************************************************/
  1189. X
  1190. Xint savetty()
  1191. X  {
  1192. X  savedacr  = _cursvar.autocr;
  1193. X  savedcbr  = _cursvar.cbreak;
  1194. X  savedecho = _cursvar.echo;
  1195. X  savedraw  = _cursvar.raw;
  1196. X  return(OK);
  1197. X  } /* savetty */
  1198. X
  1199. Xint resetty()
  1200. X  {
  1201. X  _cursvar.autocr = savedacr;
  1202. X  _cursvar.cbreak = savedcbr;
  1203. X  _cursvar.echo   = savedecho;
  1204. X  _cursvar.raw    = savedraw;
  1205. X  return(OK);
  1206. X  } /* resetty */
  1207. X
  1208. X/****************************************************************/
  1209. X/* Setupterm() sets up the terminal. On a PC, it is always suc-    */
  1210. X/* cessful, and returns 1.                    */
  1211. X/****************************************************************/
  1212. X
  1213. Xint setupterm()
  1214. X  {
  1215. X  return(1);
  1216. X  } /* setupterm */
  1217. END_OF_FILE
  1218. if test 2893 -ne `wc -c <'termmisc.c'`; then
  1219.     echo shar: \"'termmisc.c'\" unpacked with wrong size!
  1220. fi
  1221. # end of 'termmisc.c'
  1222. fi
  1223. if test -f 'unctrl.c' -a "${1}" != "-c" ; then 
  1224.   echo shar: Will not clobber existing file \"'unctrl.c'\"
  1225. else
  1226. echo shar: Extracting \"'unctrl.c'\" \(2116 characters\)
  1227. sed "s/^X//" >'unctrl.c' <<'END_OF_FILE'
  1228. X/****************************************************************/
  1229. X/* Unctrl() routines of the PCcurses package            */
  1230. X/*                                */
  1231. X/****************************************************************/
  1232. X/* This version of curses is based on ncurses, a curses version    */
  1233. X/* originally written by Pavel Curtis at Cornell University.    */
  1234. X/* I have made substantial changes to make it run on IBM PC's,    */
  1235. X/* and therefore consider myself free to make it public domain.    */
  1236. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1237. X/****************************************************************/
  1238. X/*             IMPLEMENTATION NOTE            */
  1239. X/* The conversion from a control character to a two-character    */
  1240. X/* sequence is done by the unctrl() function. In the BSD ver-    */
  1241. X/* sion of curses it is done by a macro, which uses a publi-    */
  1242. X/* cally available translation table. Some ill-behaved appli-    */
  1243. X/* cation programs use the table directly, and since it does    */
  1244. X/* not exist in this curses version such application will link    */
  1245. X/* with an error message complainting about undefined symbols.    */
  1246. X/****************************************************************/
  1247. X/* 1.0:    Release:                    870515    */
  1248. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  1249. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1250. X/****************************************************************/
  1251. X
  1252. X#include <curses.h>
  1253. X#include <curspriv.h>
  1254. X
  1255. Xstatic char    strbuf[3] = {0,0,0};
  1256. X
  1257. Xchar _curses_unctrl_rcsid[] = "@(#)unctrl.c v1.3 - 881005";
  1258. X
  1259. X/****************************************************************/
  1260. X/* Unctrl() returns a char pointer to a string corresponding to    */
  1261. X/* argument character 'c'.                    */
  1262. X/****************************************************************/
  1263. X
  1264. Xchar *unctrl(c)
  1265. X  char c;
  1266. X  {
  1267. X  int ic = c;
  1268. X  ic &= 0xff;
  1269. X  
  1270. X  if ((ic >= ' ') && (ic != 0x7f))        /* normal characters */
  1271. X    {
  1272. X    strbuf[0] = (char) ic;
  1273. X    strbuf[1] = '\0';
  1274. X    return(strbuf);
  1275. X    } /* if */
  1276. X  strbuf[0] = '^';                /* '^' prefix */
  1277. X  if (c == 0x7f)                /* DEL */
  1278. X    strbuf[1] = '?';
  1279. X  else                        /* other control */
  1280. X    strbuf[1] = ((char) ic) + '@';
  1281. X  return(strbuf);
  1282. X  } /* unctrl */
  1283. END_OF_FILE
  1284. if test 2116 -ne `wc -c <'unctrl.c'`; then
  1285.     echo shar: \"'unctrl.c'\" unpacked with wrong size!
  1286. fi
  1287. # end of 'unctrl.c'
  1288. fi
  1289. if test -f 'winclear.c' -a "${1}" != "-c" ; then 
  1290.   echo shar: Will not clobber existing file \"'winclear.c'\"
  1291. else
  1292. echo shar: Extracting \"'winclear.c'\" \(1578 characters\)
  1293. sed "s/^X//" >'winclear.c' <<'END_OF_FILE'
  1294. X/****************************************************************/
  1295. X/* Clear() routines of the PCcurses package            */
  1296. X/*                                */
  1297. X/****************************************************************/
  1298. X/* This version of curses is based on ncurses, a curses version    */
  1299. X/* originally written by Pavel Curtis at Cornell University.    */
  1300. X/* I have made substantial changes to make it run on IBM PC's,    */
  1301. X/* and therefore consider myself free to make it public domain.    */
  1302. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1303. X/****************************************************************/
  1304. X/* 1.0:    Release:                    870515    */
  1305. X/* 1.2:    Rcsid[] string for maintenance:            881002    */
  1306. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1307. X/****************************************************************/
  1308. X
  1309. X#include <curses.h>
  1310. X#include <curspriv.h>
  1311. X
  1312. Xchar _curses_winclear_rcsid[] = "@(#)winclear.c v1.3 - 881005";
  1313. X
  1314. X/****************************************************************/
  1315. X/* Wclear() fills all lines of window 'win' with blanks, and    */
  1316. X/* marks the window to be cleared at next refresh operation.    */
  1317. X/****************************************************************/
  1318. X
  1319. Xvoid    wclear(win)
  1320. X  WINDOW    *win;
  1321. X  {
  1322. X  werase(win);
  1323. X  win->_clear = TRUE;
  1324. X  } /* wclear */
  1325. X
  1326. X/****************************************************************/
  1327. X/* Clear() fills all lines of stdscr with blanks, and marks    */
  1328. X/* marks sdtscr to be cleared at next refresh operation.    */
  1329. X/****************************************************************/
  1330. X
  1331. Xvoid clear()
  1332. X  {
  1333. X  werase(stdscr);
  1334. X  stdscr->_clear = TRUE;
  1335. X  } /* clear */
  1336. END_OF_FILE
  1337. if test 1578 -ne `wc -c <'winclear.c'`; then
  1338.     echo shar: \"'winclear.c'\" unpacked with wrong size!
  1339. fi
  1340. # end of 'winclear.c'
  1341. fi
  1342. if test -f 'windel.c' -a "${1}" != "-c" ; then 
  1343.   echo shar: Will not clobber existing file \"'windel.c'\"
  1344. else
  1345. echo shar: Extracting \"'windel.c'\" \(1534 characters\)
  1346. sed "s/^X//" >'windel.c' <<'END_OF_FILE'
  1347. X/****************************************************************/
  1348. X/* Delwin() routine of the PCcurses package.            */
  1349. X/*                                */
  1350. X/****************************************************************/
  1351. X/* This version of curses is based on ncurses, a curses version    */
  1352. X/* originally written by Pavel Curtis at Cornell University.    */
  1353. X/* I have made substantial changes to make it run on IBM PC's,    */
  1354. X/* and therefore consider myself free to make it public domain.    */
  1355. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1356. X/****************************************************************/
  1357. X/* 1.0:    Release:                    870515    */
  1358. X/* 1.2:    Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1359. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1360. X/****************************************************************/
  1361. X
  1362. X#include <curses.h>
  1363. X#include <curspriv.h>
  1364. X
  1365. Xchar _curses_windel_rcsid[] = "@(#)windel.c v1.3 - 881005";
  1366. X
  1367. X/****************************************************************/
  1368. X/* Delwin() deallocates all data allocated by 'win'. If 'win'    */
  1369. X/* is a subwindow, it uses the original window's lines for sto-    */
  1370. X/* rage, and thus the line arrays are not deallocated.        */
  1371. X/****************************************************************/
  1372. X
  1373. Xvoid delwin(win)
  1374. X  WINDOW    *win;
  1375. X  {
  1376. X  int         i;
  1377. X
  1378. X  if (! (win->_flags & _SUBWIN))    /* subwindow uses 'parent's' lines */
  1379. X    {
  1380. X    for (i = 0; i < win->_maxy && win->_line[i]; i++)
  1381. X      free(win->_line[i]);
  1382. X    }
  1383. X  free(win->_minchng);
  1384. X  free(win->_maxchng);
  1385. X  free(win->_line);
  1386. X  free(win);
  1387. X  } /* delwin */
  1388. END_OF_FILE
  1389. if test 1534 -ne `wc -c <'windel.c'`; then
  1390.     echo shar: \"'windel.c'\" unpacked with wrong size!
  1391. fi
  1392. # end of 'windel.c'
  1393. fi
  1394. if test -f 'winerase.c' -a "${1}" != "-c" ; then 
  1395.   echo shar: Will not clobber existing file \"'winerase.c'\"
  1396. else
  1397. echo shar: Extracting \"'winerase.c'\" \(1991 characters\)
  1398. sed "s/^X//" >'winerase.c' <<'END_OF_FILE'
  1399. X/****************************************************************/
  1400. X/*                                */
  1401. X/* Erase() routines of the PCcurses package            */
  1402. X/*                                */
  1403. X/****************************************************************/
  1404. X/* This version of curses is based on ncurses, a curses version    */
  1405. X/* originally written by Pavel Curtis at Cornell University.    */
  1406. X/* I have made substantial changes to make it run on IBM PC's,    */
  1407. X/* and therefore consider myself free to make it public domain.    */
  1408. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1409. X/****************************************************************/
  1410. X/* 1.0:    Release:                    870515    */
  1411. X/* 1.2:    Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1412. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1413. X/****************************************************************/
  1414. X
  1415. X#include <curses.h>
  1416. X#include <curspriv.h>
  1417. X
  1418. Xchar _curses_winerase_rcsid[] = "@(#)winerase.c v1.3 - 881005";
  1419. X
  1420. X/****************************************************************/
  1421. X/* Werase() fills all lines of window 'win' with blanks and po-    */
  1422. X/* sitions the cursor at home in the scroll region.        */
  1423. X/****************************************************************/
  1424. X
  1425. Xvoid    werase(win)
  1426. X  WINDOW    *win;
  1427. X  {
  1428. X  int        *end;
  1429. X  int        *start;
  1430. X  short         y;
  1431. X  static   int     blank;
  1432. X  
  1433. X  blank = ' ' | (win->_attrs & ATR_MSK);
  1434. X
  1435. X  for (y = win->_regtop; y <= win->_regbottom; y++)    /* clear all lines */
  1436. X    {
  1437. X    start = win->_line[y];
  1438. X    end = &start[win->_maxx - 1];
  1439. X    while (start <= end)                /* clear all line */
  1440. X      *start++ = blank;
  1441. X    win->_minchng[y] = 0;
  1442. X    win->_maxchng[y] = win->_maxx - 1;
  1443. X    }
  1444. X  win->_cury = win->_regtop;                /* cursor home */
  1445. X  win->_curx = 0;
  1446. X  } /* werase */
  1447. X
  1448. X/****************************************************************/
  1449. X/* Erase() fills all lines of stdscr with blanks and positions    */
  1450. X/* the cursor at home in the scroll region.            */
  1451. X/****************************************************************/
  1452. X
  1453. Xvoid erase()
  1454. X  {
  1455. X  werase(stdscr);
  1456. X  } /* erase */
  1457. END_OF_FILE
  1458. if test 1991 -ne `wc -c <'winerase.c'`; then
  1459.     echo shar: \"'winerase.c'\" unpacked with wrong size!
  1460. fi
  1461. # end of 'winerase.c'
  1462. fi
  1463. if test -f 'winmove.c' -a "${1}" != "-c" ; then 
  1464.   echo shar: Will not clobber existing file \"'winmove.c'\"
  1465. else
  1466. echo shar: Extracting \"'winmove.c'\" \(1366 characters\)
  1467. sed "s/^X//" >'winmove.c' <<'END_OF_FILE'
  1468. X/****************************************************************/
  1469. X/* Mvwin() routine of the PCcurses package            */
  1470. X/*                                */
  1471. X/****************************************************************/
  1472. X/* This version of curses is based on ncurses, a curses version    */
  1473. X/* originally written by Pavel Curtis at Cornell University.    */
  1474. X/* I have made substantial changes to make it run on IBM PC's,    */
  1475. X/* and therefore consider myself free to make it public domain.    */
  1476. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1477. X/****************************************************************/
  1478. X/* 1.0:    Release:                    870515    */
  1479. X/* 1.2:    Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1480. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1481. X/****************************************************************/
  1482. X
  1483. X#include <curses.h>
  1484. X#include <curspriv.h>
  1485. X
  1486. Xchar _curses_winmove_rcsid[] = "@(#)winmove.c v1.3 - 881005";
  1487. X
  1488. X/****************************************************************/
  1489. X/* Mvwin() moves window 'win' to position (begx, begy) on the    */
  1490. X/* screen.                            */
  1491. X/****************************************************************/
  1492. X
  1493. Xint    mvwin(win, begy, begx)
  1494. X  WINDOW    *win;
  1495. X  int         begy, begx;
  1496. X  {
  1497. X  if ((begy + win->_maxy) >= (LINES-1) || (begx + win->_maxx) > (COLS-1))
  1498. X    return(ERR);
  1499. X  win->_begy = begy;
  1500. X  win->_begx = begx;
  1501. X  touchwin(win);
  1502. X  return(OK);
  1503. X  } /* mvwin */
  1504. END_OF_FILE
  1505. if test 1366 -ne `wc -c <'winmove.c'`; then
  1506.     echo shar: \"'winmove.c'\" unpacked with wrong size!
  1507. fi
  1508. # end of 'winmove.c'
  1509. fi
  1510. if test -f 'winscrol.c' -a "${1}" != "-c" ; then 
  1511.   echo shar: Will not clobber existing file \"'winscrol.c'\"
  1512. else
  1513. echo shar: Extracting \"'winscrol.c'\" \(2093 characters\)
  1514. sed "s/^X//" >'winscrol.c' <<'END_OF_FILE'
  1515. X/****************************************************************/
  1516. X/* Scroll() routine of the PCcurses package            */
  1517. X/*                                */
  1518. X/****************************************************************/
  1519. X/* This version of curses is based on ncurses, a curses version    */
  1520. X/* originally written by Pavel Curtis at Cornell University.    */
  1521. X/* I have made substantial changes to make it run on IBM PC's,    */
  1522. X/* and therefore consider myself free to make it public domain.    */
  1523. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1524. X/****************************************************************/
  1525. X/* 1.0:    Release:                    870515    */
  1526. X/* 1.2:    Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1527. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1528. X/****************************************************************/
  1529. X
  1530. X#include <curses.h>
  1531. X#include <curspriv.h>
  1532. X
  1533. Xchar _curses_winscrol_rcsid[] = "@(#)winscrol.c v1.3 - 881005";
  1534. X
  1535. X/****************************************************************/
  1536. X/* Scroll() scrolls the scrolling region of 'win', but only if    */
  1537. X/* scrolling is allowed and if the cursor is inside the scrol-    */
  1538. X/* ling region.                            */
  1539. X/****************************************************************/
  1540. X
  1541. Xvoid    scroll(win)
  1542. X  WINDOW    *win;
  1543. X  {
  1544. X  int         i;
  1545. X  int        *ptr;
  1546. X  int        *temp;
  1547. X  static   int     blank;
  1548. X
  1549. X  blank = ' ' | (win->_attrs & ATR_MSK);
  1550. X  if  (       (!win->_scroll)            /* check if window scrolls */
  1551. X    || (win->_cury < win->_regtop)        /* and cursor in region */
  1552. X        || (win->_cury > win->_regbottom)
  1553. X      )
  1554. X    return;
  1555. X
  1556. X  temp = win->_line[win->_regtop];
  1557. X  for (i = win->_regtop; i < win->_regbottom; i++)
  1558. X    {
  1559. X    win->_line[i] = win->_line[i+1];        /* re-arrange line pointers */
  1560. X    win->_minchng[i] = 0;
  1561. X    win->_maxchng[i] = win->_maxx - 1;
  1562. X    }
  1563. X  for (ptr = temp; ptr - temp < win->_maxx; ptr++)
  1564. X    *ptr = blank;                /* make a blank line */
  1565. X  win->_line[win->_regbottom] = temp;
  1566. X  if (win->_cury > win->_regtop)        /* if not on top line */
  1567. X    win->_cury--;                /* cursor scrolls too */
  1568. X  win->_minchng[win->_regbottom] = 0;
  1569. X  win->_maxchng[win->_regbottom] = win->_maxx - 1;
  1570. X  } /* scroll */
  1571. END_OF_FILE
  1572. if test 2093 -ne `wc -c <'winscrol.c'`; then
  1573.     echo shar: \"'winscrol.c'\" unpacked with wrong size!
  1574. fi
  1575. # end of 'winscrol.c'
  1576. fi
  1577. if test -f 'wintouch.c' -a "${1}" != "-c" ; then 
  1578.   echo shar: Will not clobber existing file \"'wintouch.c'\"
  1579. else
  1580. echo shar: Extracting \"'wintouch.c'\" \(1410 characters\)
  1581. sed "s/^X//" >'wintouch.c' <<'END_OF_FILE'
  1582. X/****************************************************************/
  1583. X/* Touchwin() routine of the PCcurses package            */
  1584. X/*                                */
  1585. X/****************************************************************/
  1586. X/* This version of curses is based on ncurses, a curses version    */
  1587. X/* originally written by Pavel Curtis at Cornell University.    */
  1588. X/* I have made substantial changes to make it run on IBM PC's,    */
  1589. X/* and therefore consider myself free to make it public domain.    */
  1590. X/*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  1591. X/****************************************************************/
  1592. X/* 1.0:    Release:                    870515    */
  1593. X/* 1.2:    Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1594. X/* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1595. X/****************************************************************/
  1596. X
  1597. X#include <curses.h>
  1598. X#include <curspriv.h>
  1599. X
  1600. Xchar _curses_wintouch_rcsid[] = "@(#)wintouch.c v1.3 - 881005";
  1601. X
  1602. X/****************************************************************/
  1603. X/* Touchwin() marks all lines of window 'win' as changed, from    */
  1604. X/* the first to the last character on the line.            */
  1605. X/****************************************************************/
  1606. X
  1607. Xvoid touchwin(win)
  1608. X  WINDOW    *win;
  1609. X  {
  1610. X  int    y;
  1611. X  int  maxy;
  1612. X  int  maxx;
  1613. X
  1614. X  maxy = win->_maxy - 1;
  1615. X  maxx = win->_maxx - 1;
  1616. X
  1617. X  for (y = 0; y <= maxy; y++)
  1618. X    {
  1619. X    win->_minchng[y] = 0;
  1620. X    win->_maxchng[y] = maxx;
  1621. X    } /* for */
  1622. X  } /* touchwin */
  1623. END_OF_FILE
  1624. if test 1410 -ne `wc -c <'wintouch.c'`; then
  1625.     echo shar: \"'wintouch.c'\" unpacked with wrong size!
  1626. fi
  1627. # end of 'wintouch.c'
  1628. fi
  1629. echo shar: End of archive 1 \(of 5\).
  1630. cp /dev/null ark1isdone
  1631. MISSING=""
  1632. for I in 1 2 3 4 5 ; do
  1633.     if test ! -f ark${I}isdone ; then
  1634.     MISSING="${MISSING} ${I}"
  1635.     fi
  1636. done
  1637. if test "${MISSING}" = "" ; then
  1638.     echo You have unpacked all 5 archives.
  1639.     rm -f ark[1-9]isdone
  1640. else
  1641.     echo You still need to unpack the following archives:
  1642.     echo "        " ${MISSING}
  1643. fi
  1644. ##  End of shell archive.
  1645. exit 0
  1646.